<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>ESP32服务器网页</title>
    <style>
        h1{
            margin: 20px;
            padding: 0px;
        }
        button{
            margin: 10px;
            padding: 0px;
            width: 100px;
            height: 50px;
        }
    </style>
    <script>
        function on() {
            fetch("/on",{method:"get",})
                .then(e=>{console.log("消息",e);})
                .catch(error=>{console.log("Error:",error);})
        }
        function off() {
            fetch("/off",{method:"get",})
                .then(e=>{console.log("消息",e);})
                .catch(error=>{console.log("Error:",error);})
        }
    </script>
</head>
<body>
    <h1>ESP32点灯网页</h1>
    <div style="padding: 10px;">
        <button onclick="on();">开灯</button>
        <button onclick="off();">关灯</button>
    </div>
</body>
​
</html>
